/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Thread;

import StaticClass.ArrSocket;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Oho
 */
public class ConnectFile extends Thread{
    ServerSocket sv  =null;
    int port ;
 
    public ConnectFile(int port)
    {
        this.port =port;
                
    }
    
    
    @Override
    public void run()
    {
        try {
            sv = new ServerSocket(port);
            while(true)
            {
                Socket sk=sv.accept();
                
                 new ThreadFile(sk).start();
//                ArrSocket.ArrFile.add(sk);

                   // Socket sk = sv.accept();
                   // new  ThreadFile(sk).start();
                
                
                
            }
        } catch (IOException ex) {
            Logger.getLogger(ConnectFile.class.getName()).log(Level.SEVERE, null, ex);            
            
        }
    }
}
